home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 45
/
Aminet 45 (2001)(GTI - Schatztruhe)[!][Oct 2001].iso
/
Aminet
/
game
/
role
/
ldmud-3.2-bin.lha
/
mud
/
doc
/
efun
/
insert_alist
< prev
next >
Wrap
Text File
|
2001-04-06
|
1KB
|
32 lines
OPTIONAL
SYNOPSIS
mixed* insert_alist (mixed key, mixed data..., mixed * alist)
int insert_alist (mixed key, mixed * keys)
DESCRIPTION
1. Form: Alist Insertion
The <key> and all following <data> values are inserted
into the <alist>. If an entry for <key> already exists
in the list, just the data values are replaced. The number
of <data> values must match the number of data arrays
in the alist, naturally.
Result is the updated <alist>.
2. Form: Key Insertion
Insert the <key> into the (ordered) array of <keys>, so that
subsequent assoc()s can perform quick lookups. Result is the
index at which <key> was inserted (or already found).
CAVEAT: when working with string keys, the index might no longer
be valid after the next call to insert_alist().
Complexity: O(lg(n) + a*n) where n is the number of keys and
s is a very small constant (for block move);
SEE ALSO
alists(LPC), assoc(E), order_alist(E)